<?php

namespace App\Http\Controllers\College\Merchant;

use App\Http\Controllers\BaseController;
use App\Http\Middleware\OpenShop\MerchantAppAuth;
use App\Service\College\CollegeCourseService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class OnlineCourseController extends BaseController
{


    /**
     * 在线学习列表
     * @param Request $request
     * @return JsonResponse
     */
    public function list(Request $request): JsonResponse
    {
        $name = $request->get('name', '');
        return $this->success(CollegeCourseService::getCourseList(MerchantAppAuth::$userId, $name));
    }

    /**
     * 在线课堂详情
     *
     */

    public function detail(Request $request, $id): JsonResponse
    {
        return $this->success(CollegeCourseService::getCourseDetail(MerchantAppAuth::$userId, $id));
    }
}
